clear all

set mem 250m
set more off
set matsiz 8000
/*choose directory*/
cd "C:\Users\bond10\Desktop\RA\Test Scores\Paper\replication files" 
use ECLSbondlang.dta, clear

/*Normalize test scores to be between 0 and 1 to match transformation*/
replace readfallk=readfallk/180
replace readspringk = readspringk/180
replace readspring1 = readspring1/180
replace readspring3 = readspring3/180


/*Enter parameters here*/
scalar B1 = 2959.23268775735
scalar B2 = 12710.2673064966
scalar B3 = 29460.2745370992
scalar B4 = 36857.0819681668
scalar B5 = 23279.9123969347
scalar B6 = 5752.4599459532
scalar k = -1.158344
scalar N1 = -428.334127060023




foreach x in fallk springk spring1 spring3         {
gen transform`x' = B1*(read`x' + k) + B2*(read`x' + k)^2 + B3*(read`x' + k)^3 + B4*(read`x' + k)^4 + B5*(read`x' + k)^5 + B6*(read`x' + k)^6 - N1
                                                       }
replace readfallk=readfallk*180
replace readspringk = readspringk*180
replace readspring1 = readspring1*180
replace readspring3 = readspring3*180												   
